//
//  SearechKeyWordTool.swift
//  MikerShop
//
//  Created by eme on 2016/11/29.
//  Copyright © 2016年 eme. All rights reserved.
//

import Foundation
import SwiftyJSON
import RxSwift
import RickonCore

/// 缓存关键字到本地
class SearechKeyWordTool  {
    private let filePath:String = NSHomeDirectory() + AppConfig.searchKeyWordPath
    static var sharedInstance : SearechKeyWordTool {
        struct Static {
            static let instance : SearechKeyWordTool = SearechKeyWordTool()
        }
        return Static.instance
    }
    
    func writeToFind(arr:[String]) -> Void {
        (arr as NSArray).write(toFile: self.filePath, atomically: true)
    }
    func readFromFind() -> [String] {
        let arr = NSArray(contentsOfFile:filePath) as? [String]
        return arr ?? []
       
    }

    
}
